home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Database Designers / Rational Rose 2000 / Rational Setup.EXE / common / lib / MSWin32-x86 / Thread / Specific.pm < prev   
Encoding:
Perl POD Document  |  1999-01-26  |  455 b   |  30 lines

  1. package Thread::Specific;
  2.  
  3. =head1 NAME
  4.  
  5. Thread::Specific - thread-specific keys
  6.  
  7. =head1 SYNOPSIS
  8.  
  9.     use Thread::Specific;
  10.     my $k = key_create Thread::Specific;
  11.  
  12. =head1 DESCRIPTION
  13.  
  14. C<key_create> returns a unique thread-specific key.
  15.  
  16. =cut
  17.  
  18. sub import {
  19.     use attrs qw(locked method);
  20.     require fields;
  21.     fields->import(@_);
  22. }    
  23.  
  24. sub key_create {
  25.     use attrs qw(locked method);
  26.     return ++$FIELDS{__MAX__};
  27. }
  28.  
  29. 1;
  30.